package com.thread.daemon.demo2;

import java.util.concurrent.ThreadFactory;

//通过编写定制的ThreadFactory可以定制由Executor创建的线程的属性
public class DaemonThreadFactory implements ThreadFactory {

	@Override
	public Thread newThread(Runnable r) {
		Thread t = new Thread(r);
		t.setDaemon(true);
		return t;
	}

}
